//
//  GSDKUserDataController.h
//  GameSDK
//
//  Created by Johnny on 2017/7/31.
//  Copyright © 2017年 Johnny. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GSDKUserLoginView.h"
typedef void (^GSDKCompletionBlock)(id responseObject);
typedef void (^GSDKFailureBlock)(NSString *msg);
@interface GSDKUserDataController : NSObject

@property (nonatomic,copy)void (^updatePhotoEndBlock)(BOOL isUpdate);
/**
 获取全部用户
 
 @return 全部用户
 */
- (NSArray *)getAllAccounds;

/**
 获取最后一次登录的账号
 
 @param userBlock 账号
 */
- (void)getDefaultUserAt:(void(^)(GSDKUserAccountModel * userAccount))userBlock;

- (void)getAccountUserAt:(void(^)(GSDKUserAccountModel * userAccount))userBlock;

- (void)saveUserDataWithUserName:(NSString *)userName
                    withPassword:(NSString *)password
                       withToken:(NSString *)token
                         withUid:(NSString *)uid
                        withType:(ThirdPartyLoginType)type
                       withOther:(NSString *)other;

- (void)registeredWithUsername:(NSString *)username
                  withPassword:(NSString *)password
                     withToken:(NSString *)token
                      withType:(ThirdPartyLoginType)type
                 withSaveAlbum:(BOOL)isSave
           withCompletionBlock:(GSDKCompletionBlock)completion
              withFailureBlock:(GSDKFailureBlock)failure;

- (void)loginWithUsername:(NSString *)username
             withPassword:(NSString *)password
                withToken:(NSString *)token
                 withType:(ThirdPartyLoginType)type
                withOther:(NSString *)other
      withCompletionBlock:(GSDKCompletionBlock)completion
         withFailureBlock:(GSDKFailureBlock)failure;

- (void)thirdPartyLogin:(ThirdPartyLoginType)type
    withCompletionBlock:(GSDKCompletionBlock)completion
       withFailureBlock:(GSDKFailureBlock)failure;

- (void)getNameWithToken:(NSString *)token
     withCompletionBlock:(GSDKCompletionBlock)completion
        withFailureBlock:(GSDKFailureBlock)failure;

@end
